#!/usr/bin/env python
import re

import PyV8

class BaseCanvasRenderingContext2D(PyV8.JSClass):
    def __init__(self, canvas):
        PyV8.JSClass.__init__(self)

        self._canvas = canvas

    @property
    def canvas(self):
        """back-reference to the canvas"""
        return self._canvas

    def applyStyle(self, style):
        style.apply(self, 0, 0, self._canvas.width, self._canvas.height)
